<template>
  <div v-loading="pagelistLoading">
    <div class="bgf">
      <my-form
        v-model="queryParams"
        :config="fromConfigdetales"
        :slotleft-list="['inp']"
        :slot-list="['add']"
        @submit="searchHandle"
        @reset="resetQuery"
        @change="searchHandle"
      >
        <div slot="inp" style="margin-right: 0.1rem">
          <el-input v-model="queryParams.Key" size="small" placeholder="输入预约活动名称搜索" />
        </div>
      </my-form>
    </div>
    <MyTable
      class="bgf"
      :column="column"
      :data="list"
      :page-sizes="[50, 100, 200, 500]"
      :current-page.sync="totalParams.skipcount"
      :total="total"
      :page-size="totalParams.maxresultcount"
      pagination
      layout="total,sizes,prev,pager,next,jumper"
      @size-change="changePagination"
      @p-current-change="changecurrent"
    />
    <el-dialog title="健康码预警" :visible.sync="dialogTableVisible">
      <el-table :data="listAurInfo">
        <el-table-column label="姓名" property="xm"></el-table-column>
        <el-table-column
          label="手机号"
          property="sjh"
          width="120"
        ></el-table-column>
        <el-table-column
          label="身份证号"
          property="sfzh"
          width="170"
        ></el-table-column>
        <el-table-column
          label="代办人身份证号"
          property="dbrsfzh"
          width="170"
        ></el-table-column>
        <el-table-column label="码状态" property="mzt"></el-table-column>
        <el-table-column
          label="红码,黄码原因"
          property="hmcmyy"
          width="200"
        ></el-table-column>
        <el-table-column
          label="码发放地"
          property="mffd"
          width="100"
        ></el-table-column>
        <el-table-column
          label="创建类型"
          property="source"
          width="120"
        ></el-table-column>
        <el-table-column
          label="首次申请时间"
          property="scsqsj"
          width="150"
        ></el-table-column>
        <el-table-column
          label="最近更新时间"
          property="zjgxsj"
          width="150"
        ></el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>
<script>
import MyForm from '@/components/MyForm/FormGenerator'
import page from "@/mixins/page";
import { fromConfigdetale } from '../column/aefhhilnot.js'
import { formatDate, formatTimeString } from "@/utils/date.js";
export default {
  name: "User",
  components: {
    MyForm
  },
  filters: {},
  mixins: [page],
  data() {
    return {
      queryParams: {
        cityid: 1,
        AreaId: "0",
        orgid: "0",
        times: null,
        status: null,
        Key: null,
      },
      dialogTableVisible: false,
      gridData: [],
      totalParams: {},
      listAurInfo: [],
      column: [
        {
          type: "index",
          width: 60,
          label: "序号",
        },
        {
          prop: "hecname",
          label: "姓名",
          width: 100,
          showOverflowTooltip: true,
        },
        {
          prop: "heccardno",
          label: "身份证号",
          width: 170,
          showOverflowTooltip: true,
        },
        {
          prop: "hecmobile",
          label: "联系方式",
          showOverflowTooltip: true,
        },
        {
          prop: "hecorgname",
          label: "陵园名称",
          showOverflowTooltip: true,
        },
        {
          prop: "hecdate",
          label: "预约入园日期",
          width: 120,
          showOverflowTooltip: true,
        },
        {
          prop: "hecendtime",
          label: "预约入园截止时间",
          width: 150,
          showOverflowTooltip: true,
        },
        {
          label: "健康码数据历史",
          width: 120,
          render: (h, scope) => {
            return (
              <span
                onClick={() => {
                  this.queryListArr(scope.row);
                }}
              >
                <i class="el-icon-view"></i>
              </span>
            );
          },
        },
        {
          prop: "hechealthcode",
          label: "拦截健康码状态",
          width: 200,
          showOverflowTooltip: true,
        },
        {
          prop: "heccityname",
          label: "拦截健康码所属地区",
          width: 200,
          showOverflowTooltip: true,
        },
        {
          prop: "hecremark",
          label: "拦截健康码备注",
          width: 200,
          showOverflowTooltip: true,
        },
      ],
      fromConfigdetales: fromConfigdetale(this),
      httpUrl: "QueryHecListByPaged",
    };
  },
  methods: {
    queryListArr(item) {
      this.api.QueryAurInfo({ id: item.apnid }).then(res => {
      this.dialogTableVisible = true;
      this.listAurInfo = item.hecloglist;
      })
    },
    changeHandle() {
      this.httpGetListActions();
    },
    resetQuery() {
      this.queryParams = {
        cityid: "0",
        AreaId: "0",
        orgid: "0",
        times: null,
        status: null,
        Key: null,
      };
      this.httpGetListActions();
    },
  },
};
</script>
